<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../../base.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="${ctx}/js/validate/jquery-1.11.1.js"></script>
    <script type="text/javascript" src="${ctx}/js/validate/jquery-validate.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/js/validate/validate.css" />
</head>
<body>
<form method="post">

<div id="menubar">
<div id="middleMenubar">
<div id="innerMenubar">
    <div id="navMenubar">
<ul>
<li id="save"><a href="#" onclick="isok();">确定</a></li>
<li id="back"><a href="list.action">返回</a></li>
</ul>
    </div>
</div>
</div>
</div>
     
<div class="textbox" id="centerTextbox">
    
    <div class="textbox-header">
    <div class="textbox-inner-header">
    <div class="textbox-title">
		新增用户信息
    </div> 
    </div>
    </div>
<div>
    <div>
		<table class="commonTable" cellspacing="1">
	        <tr>
	            <td class="columnTitle_mustbe">用户编号：</td>
	            <td class="tableContent"><input type="text" name="userCode" value="" class="required" 
	            	data-tip="请输入您的用户编号" data-valid="isNonEmpty||between:5-12" data-error="用户编号不能为空||用户编码长度为5-12位"
	            />
	            
	            </td>
	            <td class="columnTitle_mustbe">姓名：</td>
	            <td class="tableContent"><input  class="required"  type="text" name="userName" value=""
	            	data-tip="请输入您的姓名" data-valid="isNonEmpty||onlyZh||between:2-5" data-error="姓名不能为空||姓名只能为中文||姓名长度为2-5位"
	            /></td>
	        </tr>
	        <tr>
	            <td class="columnTitle_mustbe">密码：</td>
	            <td class="tableContent"><input class="required" type="password" name="password" value="" id="password"
	            	data-tip="请输入密码" data-valid="isNonEmpty||between:6-12" data-error="姓名不能为空||长度为6-12位"
	            /></td>
	            <td class="columnTitle_mustbe">确认密码：</td>
	            <td class="tableContent">
	            	<input class="required" type="password" name="repassword" value=""
	            		data-tip="请再次输入密码" data-valid="isNonEmpty||between:6-12||repassword:password" data-error="密码不能为空||长度为6-12位||两次密码不一致"
	            	/>
	            </td>
	        </tr>
	        <tr>
	            <td class="columnTitle_mustbe">手机号：</td>
	            <td class="tableContent"><input class="required" type="text" name="telphone" value=""
	            	data-tip="请输入手机号" data-valid="isNonEmpty||isMobile" data-error="手机号不能为空||手机号格式不正确"
	            /></td>
	            <td class="columnTitle_mustbe">邮箱：</td>
	            <td class="tableContent">
	            	<input  class="required"  type="text" name="email" value=""
	            		data-tip="请输入邮箱" data-valid="isNonEmpty||isEmail" data-error="邮箱不能为空||邮箱格式不正确"
	            	/>
	            </td>
	        </tr>
	        <tr>
	            <td class="columnTitle_mustbe">岗位：</td>
	            <td class="tableContent">
	            	<select name="jobsCode">
	            		<option value="">--请选择--</option>
	            		<option value="zjl">总经理</option>
	            		<option value="fzjl">副总经理</option>
	            		<option value="bmjl">部门经理</option>
	            		<option value="fgld">分管领导</option>
	            	</select>
	            </td>
	            <td class="columnTitle_mustbe">部门：</td>
	            <td class="tableContent">
	            	<select name="departmentId">
	            		<option value="">--选择部门--</option>
	            		<c:forEach items="${dataList}" var="o" varStatus="status">
	            			<option value="${o.id }">${o.departmentName }</option>
	            		</c:forEach>
	            	</select>
	            </td>
	        </tr>
		</table>
	</div>
</div>
<div style="display: none;"><input id="submit" type="submit" value=""/></div>
<script type="text/javascript">
  $('form').validate({
    onFocus: function() {
      this.parent().addClass('active');
      return false;
    },
    onBlur: function() {
      var $parent = this.parent();
      var _status = parseInt(this.attr('data-status'));
      $parent.removeClass('active');
      if (!_status) {
        $parent.addClass('error');
      }
      return false;
    }
  });
	
  $('form').on('submit', function(event) {
	  var flag = $(this).validate('submitValidate'); //return boolean;
	  if(flag){
			formSubmit('insert.action','_self')
		}else{
			event.preventDefault();
		}
  });
 
  function isok(){
	  $("#submit").click();
  }
  </script>
 
</form>
</body>
</html>

